﻿using System;
using System.Linq;
using BITS.PreCompiler.CSharp.Syntax;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BITS.PreCompiler.CSharp.Tests.Syntax
{
    public partial class TestClass
    {
        [TestMethod]
        public void Parse_Class_With_Regions()
        {
            var @class = new Namespace("Test")
            {
                Comparer.Create_Class_With_Regions()
            }
            .Classes.Single();

            foreach (var childNodesAndToken in @class.Methods.Last().GetSyntaxNode().GetLeadingTrivia())
            {
                
                Console.WriteLine(childNodesAndToken.ToFullString());
            }

            Console.WriteLine("!!!!!!!!!!!!!!");
            Console.WriteLine();

            var expectet = Comparer.Create_Class_With_Regions();
            var actual = @class.ToString();

            //Assert.AreEqual(expectet, actual);
        }

        public static partial class Comparer
        {
            public static String Create_Class_With_Regions()
            {
                return
@"public class MyClass
{
    # region A
    private TypeA MethodA()
    {
    }
    # endregion a
    #region B
    private NewClass MethodB()
    {
    }
    # endregion b
}";
            }
        }
    }
}
